package day_2022_7_to_8.day48;

/**
 * @author haomin
 * @date 2022/08/07 10:36
 **/
public class Day23_2_Num6136_ArithmeticTriplets {
    class Solution {
        public int arithmeticTriplets(int[] nums, int diff) {
            int count = 0;
            for(int i = 0;i < nums.length;i++){
                for(int j = i+1;j < nums.length;j++){
                    for(int k = j+1;k < nums.length;k++){
                        if(nums[j]-nums[i] == diff && nums[k]-nums[j] == diff){
                            count++;
                        }
                    }
                }
            }
            return count;
        }
    }
}